home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / userbox / publicdomain / vim-4.2 / doc / vim_w32.txt < prev    next >
Text File  |  1996-06-16  |  14KB  |  281 lines

  1. *vim_w32.txt*   For Vim version 4.2.  Last modification: 1996 June 13
  2.  
  3. This file documents the idiosyncrasies of the Win32 version of Vim.
  4.  
  5. The Win32 version was written by George V. Reilly <gvr@halcyon.com>.
  6. The original Windows NT port was done by Roger Knobbe <RogerK@wonderware.com>.
  7.  
  8. The Win32 version of Vim works on both Windows NT and Windows 95.  It is a
  9. console-mode application (i.e., it runs in a command prompt window or a "DOS
  10. box").  It is not a full-fledged Windows GUI application, although it may
  11. become one some day.  It will not run in the Win32s subsystem in Windows
  12. 3.1; use the 32-bit DOS version of Vim instead.  See |vim_dos.txt|.
  13.  
  14. Vim for Win32 compiles with the Microsoft Visual C++ 2.0 compiler and later,
  15. and with the Borland C++ 4.5 32-bit compiler and later.  It compiles on
  16. Windows 95 and all four NT platforms: i386, Alpha, MIPS, and PowerPC.  The
  17. NT/i386 and the Windows 95 binaries are identical.  Use Makefile.w32 to
  18. compile with Visual C++ and Makefile.b32 to compile with Borland C++.
  19.  
  20. You can set the colour used in five modes with nine termcap options.  Which of
  21. the five modes is used for which action depends on the |'highlight'| option.
  22.  
  23.     ":set t_mr=^V^[\|xxm"        start of invert mode
  24.     ":set t_md=^V^[\|xxm"        start of bold mode
  25.     ":set t_me=^V^[\|xxm"        back to normal text
  26.  
  27.     ":set t_so=^V^[\|xxm"        start of standout mode
  28.     ":set t_se=^V^[\|xxm"        back to normal text
  29.  
  30.     ":set t_us=^V^[\|xxm"        start of underline mode
  31.     ":set t_ue=^V^[\|xxm"        back to normal text
  32.  
  33.     ":set t_ZH=^V^[\|xxm"        start of italics mode
  34.     ":set t_ZR=^V^[\|xxm"        back to normal text
  35.  
  36. ^V is CTRL-V
  37. ^[ is ESC
  38. xx must be replaced by a decimal code, which is the foreground colour number
  39.    and background colour number added together:
  40.  
  41. COLOUR        FOREGROUND    BACKGROUND
  42.  black            0            0
  43.  blue            1           16
  44.  green            2           32
  45.  cyan            3           48
  46.  red            4           64
  47.  magenta        5           80
  48.  brown            6           96
  49.  lightgray        7          112
  50.  darkgray        8          128
  51.  lightblue        9          144
  52.  lightgreen       10          160
  53.  lighcyan       11          176
  54.  lightred       12          192
  55.  lightmagenta       13          208
  56.  yellow           14          224
  57.  white           15          240
  58.  
  59. When you use 0, the colour is reset to the one used when you started Vim
  60. (usually 7, lightgray on black, but you can override this in NT.  If you have
  61. overridden the default colours in a command prompt, you may need to adjust
  62. some of the highlight colours in your vimrc---see below).
  63.  
  64. The defaults for the various highlight modes are:
  65.     t_mr    112         reverse mode: black text on lightgray
  66.     t_md     63         bold mode: white text on cyan
  67.     t_me      0         normal mode (revert to default)
  68.  
  69.     t_so     31         standout mode: white text on blue
  70.     t_se      0         standout mode end (revert to default)
  71.  
  72.     t_czh    225         italic mode: blue text on yellow
  73.     t_czr      0         italic mode end (revert to default)
  74.  
  75.     t_us     67         underline mode: cyan text on red
  76.     t_ue      0         underline mode end (revert to default)
  77.  
  78. These colours were chosen because they also look good when using an inverted
  79. display, but you can change them to your liking.
  80.  
  81. Example:
  82. :set t_mr=^V^[\|97m        " start of invert mode: blue on brown
  83. :set t_md=^V^[\|67m        " start of bold mode: cyan on red
  84. :set t_me=^V^[\|112m        " back to normal mode: black on light gray
  85.  
  86. :set t_so=^V^[\|37m        " start of standout mode: magenta on green
  87. :set t_se=^V^[\|112m        " back to normal mode: black on light gray
  88.  
  89. If the "tx" (textmode) option is set (which is the default), Vim will accept
  90. a single <NL> or a <CR><NL> pair for end-of-line.  When writing a file, Vim
  91. will use <CR><NL>.  Thus, if you edit a file and write it, <NL> is replaced
  92. with <CR><NL>.  If the "tx" option is not set, a single <NL> will be used
  93. for end-of-line.  A <CR> will be shown as ^M.  You can use Vim to replace
  94. <NL> with <CR><NL> by reading in any mode and writing in text mode (":se
  95. tx").  You can use Vim to replace <CR><NL> with <NL> by reading in text mode
  96. and writing in non-text mode (":se notx"). 'textmode' is set automatically
  97. when 'textauto' is on (which is the default), so you don't really have to
  98. worry about what you are doing.            |'textmode'| |'textauto'|
  99.  
  100. When 'restorescreen' is set (which is the default), Vim will restore the
  101. original contents of the console when exiting or when executing external
  102. commands.  If you don't want this, use ":set nors".    |'restorescreen'|
  103.  
  104. Using backslashes in file names can be a problem.  Vi halves the number of
  105. backslashes for some commands.  Vim is a bit more tolerant and backslashes
  106. are not removed from a file name, so ":e c:\foo\bar" works as expected.  But
  107. when a backslash is used before a special character (space, comma, backslash,
  108. etc.), it is removed.  Use slashes to avoid problems: ":e c:/foo/bar" works
  109. fine.  Vim will replace the slashes with backslashes internally, to avoid
  110. problems with some MS-DOS programs and Win32 programs.
  111.  
  112. If you want to edit a script file or a binary file, you should reset the
  113. 'textmode' and 'textauto' options before loading the file.  Script files and
  114. binary files may contain single <NL> characters which would be replaced with
  115. <CR><NL>.  You can reset 'textmode' and 'textauto' automatically by starting
  116. Vim with the "-b" (binary) option.
  117.  
  118. You should set the environment variable "VIM" to the directory where the Vim
  119. documentation files are.  If "VIM" is used but not defined, "HOME" is tried
  120. too.
  121.  
  122. If the HOME environment variable is not set, the value "C:/" is used as a
  123. default.
  124.  
  125. The default help filename is "$VIM\vim_help.txt".  If the environment variable
  126. $VIM is not defined or the file is not found, the Win32 search path is used to
  127. search for the file "vim_help.txt".  If you do not want to put "vim_help.txt"
  128. in your search path, use the command ":set helpfile=pathname" to tell Vim
  129. where the help file is.                    |'helpfile'|
  130.  
  131. Vim will look for initializations in eight places.  The first that is found
  132. is used and the others are ignored.  The order is:
  133.     -  The environment variable VIMINIT
  134.     -  The file "$VIM/_vimrc"
  135.     -  The file "$HOME/_vimrc"
  136.     -  The file "$VIM/.vimrc"
  137.     -  The file "$HOME/.vimrc"
  138.     -  The environment variable EXINIT
  139.     -  The file "$VIM/_exrc"
  140.     -  The file "$HOME/_exrc"
  141.  
  142. The only kind of terminal type that the Win32 version of Vim understands is
  143. "win32", which is built-in.  If you set the TERM environment variable to
  144. anything else, you will probably get very strange behaviour from Vim.  This is
  145. most likely to happen when running a non-standard shell such as Cygnus's
  146. GNU-Win32 bash (http://www.cygnus.com/misc/gnu-win32) or the one in the MKS
  147. toolkit.  Use "unset TERM" before starting Vim!
  148.  
  149. The ":cd" command recognizes the drive specifier and changes the current
  150. drive.  Use ":cd c:" to make drive C the active drive.  Use ":cd d:\foo" to go
  151. to the directory "foo" in the root of drive D.  UNC names are also recognized;
  152. e.g., ":cd \\server\share\dir".                |:cd|
  153.  
  154. Use CTRL-BREAK instead of CTRL-C to interrupt searches.  The CTRL-C is not
  155. detected until a key is read.
  156.  
  157. Temporary files (for filtering) are put in the current directory.
  158.  
  159. The default for the 'sh' ('shell') option is "command.com" on Windows 95 and
  160. "cmd.exe" on Windows NT.  If SHELL is defined, it is used instead, and if
  161. SHELL is not defined but COMSPEC is, COMPSPEC is used.  External commands are
  162. started with "command /c <command_name>".  Typing CTRL-Z starts a new
  163. command subshell.  Return to Vim with "exit".        |'shell'| |CTRL-Z|
  164.  
  165. The Win32 binary was compiled with Visual C++ version 4.0, using Makefile.w32.
  166. Other compilers should also work.  If you get all kinds of strange error
  167. messages when compiling (you shouldn't with the Microsoft or Borland 32-bit
  168. compilers), try adding <CR> characters at the end of each line.  This can be
  169. done with the addcr program: "nmake -f makefile.w32 addcr".  This will compile
  170. addcr.c to addcr.exe and then execute the addcr.bat file.  Sometimes this
  171. fails.  In that case, execute the addcr.bat file from the DOS prompt.
  172.  
  173. The Win32 version of Vim supports using the mouse.  If you have a two-button
  174. mouse, the middle button can be emulated by pressing both left and right
  175. buttons simultaneously.                    |mouse_using|
  176.  
  177. Q. Why does the Win32 version of Vim update the screen so slowly on Windows 95?
  178. A. The support for Win32 console mode applications is very buggy in Win95.
  179.    For some unknown reason, the screen updates very slowly when Vim is run at
  180.    one of the standard resolutions (80x25, 80x43, or 80x50) and the 16-bit DOS
  181.    version updates the screen much more quickly than the Win32 version.
  182.    However, if the screen is set to some other resolution, such as by ":set
  183.    columns=100" or ":set lines=40", screen updating becomes about as fast as
  184.    it is with the 16-bit version.
  185.  
  186.    WARNING: Changing 'columns' may make Windows 95 crash while updating the
  187.    window (complaints --> Microsoft).  Since this mostly works, this has not
  188.    been disabled, but be careful with changing 'columns'.
  189.  
  190.    Changing the screen resolution makes updates faster, but it brings problems
  191.    with it of its own.  External commands (e.g., ":!dir") can cause Vim to
  192.    freeze when the screen is set to a non-standard resolution, particularly
  193.    when 'columns' is not equal to 80.  It is not possible for Vim to reliably
  194.    set the screen resolution back to the value it had upon startup before
  195.    running external commands, so if you change the number of 'lines' or
  196.    'columns', be very, very careful.  In fact, Vim will not allow you to
  197.    execute external commands when 'columns' is not equal to 80, because it is
  198.    so likely to freeze up afterwards.
  199.  
  200.    None of the above applies on Windows NT.  Screen updates are fast, no
  201.    matter how many 'lines' or 'columns' the window is set to, and external
  202.    commands will not cause Vim to freeze.
  203.  
  204. Q. So if the Win32 version updates the screen so slowly on Windows 95 and the
  205.    16-bit DOS version updates the screen quickly, why would I want to run the
  206.    Win32 version?
  207. A. Firstly, the Win32 version isn't that slow, especially when the screen is
  208.    set to some non-standard number of 'lines' or 'columns'.  Secondly, the
  209.    16-bit DOS version has some severe limitations: it can't edit big files and
  210.    it doesn't know about long filenames.  The Win32 version doesn't have these
  211.    limitations and it's faster overall (the same is true for the 32-bit DJGPP
  212.    DOS version of Vim).  The Win32 version is smarter about handling the
  213.    screen, the mouse, and the keyboard than the DJGPP version is.
  214.  
  215. Q. And what about the 16-bit DOS version versus the Win32 version on NT?
  216. A. There are no good reasons to run the 16-bit DOS version on NT.  The Win32
  217.    version updates the screen just as fast as the 16-bit version does when
  218.    running on NT.  All of the above disadvantages apply.  Finally, DOS
  219.    applications can take a long time to start up and will run more slowly.  On
  220.    non-Intel NT platforms, the DOS version is almost unusably slow, because it
  221.    runs on top of an 80x86 emulator.
  222.  
  223. Q. Why can't I paste into Vim when running Windows 95?
  224. A. In the properties dialog box for the MS-DOS window, go to "MS-DOS
  225.    Prompt/Misc/Fast pasting" and make sure that it is NOT checked.  You should
  226.    also do ":set paste" in Vim to avoid unexpected effects.    |'paste'|
  227.  
  228. Q. How do I type dead keys on Windows 95?
  229.    (A dead key is an accent key, such as acute, grave, or umlaut, that doesn't
  230.    produce a character by itself, but when followed by another key, produces
  231.    an accented character, such as a-acute, e-grave, u-umlaut, n-tilde, and so
  232.    on.  Very useful for most European languages.  English-language keyboard
  233.    layouts don't use dead keys, as far as we know.)
  234. A. You don't.  The console mode input routines simply do not work correctly in
  235.    Windows 95, and I have not been able to work around them.  In the words
  236.    of a senior developer at Microsoft:
  237.     Win95 console support has always been and will always be flaky.
  238.  
  239.     The flakiness is unavoidable because we are stuck between the world of
  240.     MS-DOS keyboard TSRs like KEYB (which wants to cook the data;
  241.     important for international) and the world of Win32.
  242.  
  243.     So keys that don't "exist" in MS-DOS land (like dead keys) have a
  244.     very tenuous existence in Win32 console land.  Keys that act
  245.     differently between MS-DOS land and Win32 console land (like
  246.     capslock) will act flaky.
  247.  
  248.     Don't even _mention_ the problems with multiple language keyboard
  249.      layouts...
  250.  
  251.    You may be able to fashion some sort of workaround with the digraphs
  252.    mechanism.                            |digraphs|
  253.  
  254.    Alternatively, you can try one of the DOS versions of Vim where dead keys
  255.    reportedly do work.
  256.  
  257. Q. How do I type dead keys on Windows NT?
  258. A. Dead keys work on NT.  Just type them as you would in any other application.
  259.  
  260. Q. When will a real GUI version of Vim (gvim) for Win32 with scrollbars,
  261.    menus, pasting from the clipboard, and so on become available?
  262. A. A few months after Vim 4.0 is released.  Apart from the features you
  263.    might expect in gvim (see |vim_gui.txt|), it is expected that a real GUI
  264.    version will also be able to handle dead keys correctly and that the
  265.    problems with external commands will be a thing of the past.
  266.  
  267. Q. I'm using Vim to edit a symbolically linked file on a Unix NFS file server.
  268.    When I write the file, Vim does not "write through" the symlink.  Instead,
  269.    it deletes the symbolic link and creates a new file in its place.  Why?
  270. A. On Unix, Vim is prepared for links (symbolic or hard).  A backup copy of
  271.    the original file is made and then the original file is overwritten.  This
  272.    assures that all properties of the file remain the same.  On non-Unix
  273.    systems, the original file is renamed and a new file is written.  Only the
  274.    protection bits are set like the original file.  However, this doesn't work
  275.    properly when working on an NFS-mounted file system where links and other
  276.    things exist.  The only way to fix this in the current version is not
  277.    making a backup file, by ":set nobackup nowritebackup"     |'writebackup'|
  278.  
  279.  
  280.  vim:ts=8:sw=8:js:tw=78:fo=tcq2:
  281.